<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2018/1/14
  Time: 10:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<html>
<head>
    <title>InsertCourse</title>
    <script type="text/javascript" src="/js/jquery-3.2.1.min.js"></script>

</head>
<body>

    <table border="1" width="600px" align="center" style="text-align: center">
        <tr>
            <td>课程号</td>
            <td>课程名称</td>
            <td>老师工号</td>
            <td width="110">操作</td>
        </tr>
        <c:forEach var="list" items="${lists}">
        <tr>
            <td>${list.courseid}</td>
            <td>${list.coursename}</td>
            <td>${list.teacherid}</td>
            <td><a href="/ModifyCourse?c_id=${list.courseid}&c_name=${list.coursename}&t_id=${list.teacherid}"><input type="button" id="mod" value="修改"></a>
                <a href="/DeleteCourse?c_id=${list.courseid}"><input type="button" id="delete" value="删除"></a> </td>
        </tr>
        </c:forEach>
        <tr id="modify" hidden >
            <form action="/ModifyCourse" method="get">
                <td><input type="text" name="courseid" placeholder="请输入课程号" style="border: none"></td>
                <td><input type="text" name="name" placeholder="请输入课程名称" style="border: none"></td>
                <td><input type="text" name="teacherid" placeholder="请输入老师工号" style="border: none"></td>
                <td><input type="submit" value="提交" ></td>
            </form>
        </tr>

    <tr id="insert" hidden >
        <form action="/Insert" method="get">
        <td><input type="text" name="courseid" placeholder="请输入课程号" style="border: none"></td>
        <td><input type="text" name="name" placeholder="请输入课程名称" style="border: none"></td>
        <td><input type="text" name="teacherid" placeholder="请输入老师工号" style="border: none"></td>
        <td><input type="submit" value="提交" ></td>
        </form>
    </tr>
        <tr>
            <td colspan="4" align="center"><input type="button"  id="button" style="width: 100px" value="添加" ></td>
        </tr>
    </table>



<script>
    $("#button").click(function () {
        $("#insert").show();
    })
    $("#mod").click(function () {
        $("#modify").show();
    })
   /* function modify(obj) {
        $("."+obj).prop("readonly",false);
    }*/

</script>
<%--</form>--%>
</body>
</html>
